package pacBiopackage;

import java.io.PrintWriter;

public class PacBioWriteStatistics 
{
	public void writeStats(PacBioErrorStatisticsContainer stat, PrintWriter pw)
	{
		pw.println("> Error statistics");
		pw.println(stat.getErrors().toString().substring(1,stat.getErrors().toString().length()-1));
		pw.println("> Insert freq");
		pw.println(stat.getInsertFreq().toString().substring(1,stat.getInsertFreq().toString().length()-1));
		pw.println("> Uncertain position");
		pw.println(stat.getPositionsErrors().toString().substring(1,stat.getPositionsErrors().toString().length()-1));
		pw.println("> Uncertain position2");
		pw.println(stat.getPositionsErrors2().toString().substring(1,stat.getPositionsErrors2().toString().length()-1));
		
		pw.println("> Mismatch freq");
		for(int i=0; i < 4;++i)
		{
			if(i==0)
			{
				pw.println(stat.getMismatchErrorType().get("A").toString().substring(1,stat.getMismatchErrorType().get("A").toString().length()-1));
			}
			else if(i==1)
			{
				pw.println(stat.getMismatchErrorType().get("C").toString().substring(1,stat.getMismatchErrorType().get("C").toString().length()-1));
			}
			else if(i==2)
			{
				pw.println(stat.getMismatchErrorType().get("G").toString().substring(1,stat.getMismatchErrorType().get("G").toString().length()-1));
			}
			else if(i==3)
			{
				pw.println(stat.getMismatchErrorType().get("T").toString().substring(1,stat.getMismatchErrorType().get("T").toString().length()-1));
			}
			else if(i==4)
			{
				pw.println(stat.getMismatchErrorType().get("N").toString());
			}
		}
		pw.println("> enviourmentInsert");
		pw.println(stat.getInsertEnviourment().toString().substring(1,stat.getInsertEnviourment().toString().length()-1));
		pw.println("> enviourmentDeletion");
		pw.println(stat.getDeletionEnviourment().toString().substring(1,stat.getDeletionEnviourment().toString().length()-1));
		pw.println("> enviourmentSNP");
		pw.println(stat.getSNPEnviourment().toString().substring(1,stat.getSNPEnviourment().toString().length()-1));
		pw.println();
	}
}
